using System.Collections;
using System.Collections.Generic;
using UnityEngine;

#if UNITY_EDITOR
using UnityEditor;
#endif
using System;

[Serializable]
public class GT_FloatNode : GT_NodeBase
{
    #region Variables
    public float nodeValue;
    public GT_NodeOutput output;
    #endregion

    #region Constrcutor
    public GT_FloatNode()
    {
        output = new GT_NodeOutput();
    }
    #endregion

    #region Main Methods
    public override void InitNode()
    {
        base.InitNode();
        nodeType = NodeType.Float;
        nodeRect = new Rect(10f, 10f, 150f, 65f);
    }

    public override void UpdateNodes(Event e, Rect viewRect)
    {
        base.UpdateNodes(e, viewRect);
    }

#if UNITY_EDITOR
    public override void UpdateNodeGUI(Event e, Rect viewRect, GUISkin viewSkin)
    {
        base.UpdateNodeGUI(e, viewRect, viewSkin);

        if (GUI.Button(new Rect(nodeRect.x + nodeRect.width, nodeRect.y + (nodeRect.height * 0.5F) - 12F, 24F, 24F), "", viewSkin.GetStyle("NodeOutput")))
        {
            if (parentGraph != null)
            {
                parentGraph.wantsConnection = true;
                parentGraph.connectionNode = this;
            }
        }
    }

    public override void DrawNodeProperties()
    {
        base.DrawNodeProperties();

        nodeValue = EditorGUILayout.FloatField("Float Value:", nodeValue);
    }
#endif
    #endregion

    #region Utility Methods

    #endregion
}
